home *** CD-ROM | disk | FTP | other *** search
- #include "Compares.h"
-
- #pragma fourbyteints on
- /* compareMnem: used to compare opcodes in the opcode table */
-
- int compareMnem(const void *opc1, const void *opc2)
- {
- return(*(long *)opc1 - *(long *)opc2);
- }
-
- /* cmpsymb: used to compare strings in the Symbol Table */
-
- int cmpsymb(const void *opc1, const void *opc2)
- {
- return(RelString(**(StringHandle *)opc1, **(StringHandle *)opc2, true, true));
- }
-
- int CompareFirstLast(const void *opc1, const void *opc2)
- {
- register unsigned short *tempP = (unsigned short *)opc2;
- unsigned short d1, d2;
- int d0;
-
- d2 = *(short *)opc1;
- d0 = d2;
- d1 = *tempP++;
- if ((d0 -= d1) > 0) {
- d0 = d2;
- d1 = *tempP;
- if ((d0 -= d1) <= 0)
- d0 = 0;
- }
-
- return d0;
- }
-
- /* compareOpc: compare function to search for the instruction
- currently executing */
-
- int compareOpc(const void *opc1, const void *opc2)
- {
- register unsigned short *pntr;
- register unsigned short a, b, c;
-
- a = *(unsigned short *)opc1;
- pntr = (unsigned short *)opc2;
- b = *pntr++;
- c = *pntr;
- return ((c < a ? (int)1L : (int)0L) - (a < b ? (int)1L : (int)0L));
- }
- #pragma fourbyteints reset
-
-